This invention relates generally to the field of computer systems. More particularly, a system and method are provided for using secondary keys to identify cached data to be invalidated.
In traditional caching schemes, each cached data object or item (e.g., a web page, a document, a set of data) is assigned an identifier that uniquely identifies the object throughout a network or other collection of computer systems. Thus, a cached web page may be identified by a URL (Uniform Resource Locator) or a URL combined with information that identifies a particular session or connection (e.g., a header or a cookie). When the cached page is requested from the cache, the request includes the URL, or other unique identifier, so that the cache can identify the correct page.
A data object's URL, when used as a unique identifier, is usually assigned by the source of the object, such as an application or database, and may be generated when the data object is generated, served or cached. The application is responsible for maintaining or remembering the mapping between the data objects it produces and the URLs assigned to the objects.
In many caching schemes, cached data objects must be specifically invalidated when they are updated or otherwise become obsolete. To invalidate a cached data object having a URL as its unique identifier, the data object's URL is specified by the application (or other entity) in an invalidation message directed to the cache in which the data object resides. Or, an invalidation message may include the same information that was used to generate the unique identifier; a cache receiving the invalidation message can thereby re-generate the identifier and invalidate the desired data item.
However, it can be very inefficient and time consuming to issue multiple invalidation messages when a number of data objects must be invalidated. In addition, a given data object may be cached multiple times, in one or multiple caches, under different URLs or other primary identifiers. This makes it even more onerous for an application that produces or serves the data to maintain mappings between data objects it provides to a cache and the identifiers the cache uses to identify them.
One situation in which a number of cached data objects may need to be invalidated is when a source of multiple data objects changes, which may cause their content to change. More generally, the cache must invalidate data objects from a given data source, when that source changes, in order to maintain consistency between the cache and the data source.
Therefore, there is a need for a system and a method for identifying to a cache multiple cached objects that must be invalidated, without having to specify the unique or primary identifiers for each object.